﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Domain.审计字段;

namespace PersonnelSystemManagement.系统管理
{
    /// <summary>
    /// 用户信息表
    /// </summary>
    public class Users : AuditableEntityBase
    {
        /// <summary>
        /// 主键 ID
        /// </summary>
        [Key]
        public int id { get; set; }

        /// <summary>
        /// 用户昵称
        /// </summary>
        [StringLength(100, ErrorMessage = "用户昵称长度不能超过 100 个字符")]
        public string? Nickname { get; set; }

        /// <summary>
        /// 手机号
        /// </summary>
        [StringLength(100, ErrorMessage = "手机号长度不能超过 100 个字符")]
        public string? Phone { get; set; }

        /// <summary>
        /// 邮箱
        /// </summary>
        [StringLength(100, ErrorMessage = "邮箱长度不能超过 100 个字符")]
        [EmailAddress(ErrorMessage = "邮箱格式不正确")]
        public string? Email { get; set; }

        /// <summary>
        /// 账号
        /// </summary>
        [StringLength(100, ErrorMessage = "账号长度不能超过 100 个字符")]
        public string? Account { get; set; }

        /// <summary>
        /// 密码
        /// </summary>
        [StringLength(100, ErrorMessage = "密码长度不能超过 100 个字符")]
        public string? Password { get; set; }

        /// <summary>
        /// 公司信息 ID，关联公司信息表
        /// </summary>
        public int? CompanyInfoID { get; set; }
    }
}
